package com.bw.lyc.mvp.view.live;

import android.graphics.Color;
import android.os.Bundle;
import android.view.View;

import com.blankj.utilcode.util.BarUtils;
import com.bw.lyc.R;
import com.bw.lyc.util.StatusBarColorUtils;
import com.shuyu.gsyvideoplayer.video.StandardGSYVideoPlayer;

import androidx.annotation.Nullable;

public class FullVideoActivity extends StatusBarColorUtils {

    private StandardGSYVideoPlayer full_gsy_player;
    private String url;

    @Override
    protected void onCreate(@Nullable @org.jetbrains.annotations.Nullable
                                    Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_full_video);
        setStatusBarColor(Color.BLACK);
        url = getIntent().getExtras().getString("live_url");
        full_gsy_player = findViewById(R.id.full_gsy_player);
        full_gsy_player.setUp(url, true, "");
        full_gsy_player.getCurrentPlayer().setAutoFullWithSize(true);
        full_gsy_player.getCurrentPlayer().startWindowFullscreen(this, false, true);
        full_gsy_player.getBackButton().setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finish();
            }
        });
        full_gsy_player.startPlayLogic();
    }

    @Override
    public View addStatusView() {
        return f(R.id.full_video_root);
    }
}
